#ifndef CVERTEX_H
#define CVERTEX_H


class CEdge;
class CFace;
class CMesh;

// STD
#include <vector>

// PROJECT
#include "cpoint.h"
#include "cedge.h"
#include "cface.h"
#include "cmesh.h"

class CVertex
{
public:
	CVertex();
	CVertex(const CVertex &);
	CVertex(double, double, double, CMesh * = NULL);
	CVertex(CPoint, CMesh * = NULL);

	double				getX();
	double				getY();
	double				getZ();
	CPoint				getPosition();
	double				getOriginalX();
	double				getOriginalY();
	double				getOriginalZ();
	CPoint				getOriginalPosition();
	CPoint				getNormal();
	bool				isNormalSet();
	CMesh *				getParentMesh();

	void				setX(double);
	void				setY(double);
	void				setZ(double);

	void				setPosition (double, double, double);
	void				setPosition (CPoint);
	void				setNormal (double, double, double);
	void				setNormal (CPoint);
	void				SetParentMesh(CMesh *);

	void				addEdge(CEdge *);
	void				addFace(CFace *);
	void				removeEdge(CEdge *);
	void				removeFace(CFace *);

	void				computeNormal();

	void				clearEdgelist();
	void				clearFaceList();

	std::vector<CEdge*>	m_EdgeList;
	std::vector<CFace*>	m_FaceList;
protected:
	CPoint				m_Position;
	CPoint				m_OriginalPosition;
	CPoint				m_Normal;

	bool				m_bNormalSet;

	CMesh *				m_pParentMesh;

};
#endif // CVERTEX_H
